<template>
    <view>

        <a-drawer width="1200" v-model:visible="visible" class="custom-class" style="color: red"
            :title="`${flow?.serviceName}`" placement="right">
            <a-card title="请选择下一节点">
                <template #extra>   <a-button type="primary">确认</a-button></template>
             
                <a-table :columns="columns" :dataSource="tableData" rowKey="nodeId"
                    :pagination="false" :row-selection="{
                        selectedRowKeys: selectedRowKeys,
                        type: 'radio',
                    }">
                </a-table>


            </a-card>

            <view v-if="flow.serviceType == '论文'">
                <PaperDesc :record="project"></PaperDesc>
            </view>
        </a-drawer>
    </view>
</template>
<script setup>
import PaperDesc from '../../project/paper/components/PaperDesc.vue';
import useApp from '@/hooks';
const { $ } = useApp();
const visible = ref(false);
const flow = ref(null)
const project = ref(null)
const audit = ref(null)
const columns = ref([
    {
        title: '节点名称',
        dataIndex: 'name',

    },
    {
        title: '节点ID',
        dataIndex: 'nodeId',
    }
])

const tableData = ref([
    {
        nodeId:'kyc',
        name:'科研处'
    },
    {
        nodeId:'jwc',
        name:'教务处'
    },
    {
        nodeId:'yjsb',
        name:'研究生部'
    },
    {
        nodeId:'gdjyyjzx',
        name:'高等教育研究中心'
    }
])
$.on('preview-flow', e => {
    console.log(e)
    flow.value = e;
    flow.value.serviceName = '测试纵向课题'

    project.value = JSON.parse(e.flowParam);

    if (e.currentNodeType == 'TASK') {
        visible.value = true;
    }
})
</script>